<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>试卷管理</title>
    <#include "/common/link.ftl">
<script>
    <#assign single = 0 />
    <#assign judge = 0 />
    <#assign multiple = 0 />
</script>
</head>
<body class="hold-transition skin-black sidebar-mini">
<div class="wrapper">
    <#include "/common/navbar.ftl">
    <#assign currentMenu="exam"/>
    <#include "/common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>试卷预览</h1>
        </section>
        <section class="content">
            <div class="box" style="padding: 10px">
                <div class="row">
                    <div class="col-md-offset-4 col-md-8">
                        <h1 class="col-md-offset-1">${exam.title}</h1>
                    </div>

                    <div class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-body">
                                <div class="col-md-4">时间：${exam.examMinute}分钟</div>
                                <div class="col-md-4">总分：${exam.totalScore}分</div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="panel panel-default">

                        <div class="panel-heading" id="single">

                        </div>
                    <#list s as Choice>
                        <div class="panel-body">
                            <p>${Choice.sequence}.${Choice.question.title}<span>（${Choice.score}分）</span></p>
                            <#list Choice.question.questionAll as qusetionItem>
                            <p>${qusetionItem.title}</p>
                            </#list>
                            <div style="color:red">正确答案：${Choice.question.answers}</div>
                        </div>
                        <#assign single+=Choice.score />
                    </#list>
                    <div class="panel-heading" id="multiple">

                    </div>
                    <#list m as Choice>
                        <div class="panel-body">
                            <p>${Choice.question.title}<span>（${Choice.score}分）</span></p>
                            <#list Choice.question.questionAll as qusetionItem>
                                <p>${qusetionItem.title}</p>
                            </#list>
                            <div style="color:red">正确答案：${Choice.question.answers}</div>
                        </div>
                        <#assign multiple+=Choice.score />
                    </#list>
                    <div class="panel-heading" id="judge">
                    </div>
                    <#list j as Choice>
                        <div class="panel-body">
                            <p>${Choice.question.title}<span>（${Choice.score}分）</span></p>
                            <#list Choice.question.questionAll as qusetionItem>
                                <p>${qusetionItem.title}</p>
                            </#list>
                            <div style="color:red">正确答案：${(Choice.question.judgeRight)?string("正确","错误")}</div>
                        </div>
                        <#assign judge+=Choice.score />
                    </#list>
                </div>
            </div>
        </section>
    </div>
    <#include "/common/footer.ftl">
</div>
<script>
    $(function () {
        $("#single").append("<h3>一、单选题（共${single}分）</h3>");
        $("#multiple").append("<h3>二、多选题（共${multiple}分）</h3>");
        $("#judge").append("<h3>三、判断题（共${judge}分）</h3>");
    })
</script>
</body>
</html>
